<?php

namespace controller\docs;
class home
{
    var $data = [];

    public function __construct()
    {
        //通过模型捞取数据
        $this->data['site'] = model('siteinfo')->get();
    }

    public function indexPage()
    {
        $this->data['title'] = "QAPP简介";
        $v=view_plates();
        $v->addData($this->data);
        echo $v->render("docs/index");
    }

    public function docPage($doctitle = '')
    {
        $this->data['title'] = "QAPP文档";
        if (!$doctitle) {
            //具体文档，否则加载第一篇文档
            $doctitle = 1;
        }
        $a = qqq_select_art('文档', ['id' => $doctitle]);
        if (!$a) {
            $a = [];
        }
//        dump_pre(model("docs")->getMenu());
//        $this->data['menu'] = ;
        $this->data['menu'] = model("docs/docs")->getMenu();
        $this->data['art'] = $a;

//dump_pre($a);
        view_plates()->addData($this->data);
        echo view_plates()->render("docs/page");
    }

    public function aboutPage()
    {
        $about = qqq_all_cfg(24);
        $this->data['title'] = $about['栏目标题'];
        $this->data['content'] = $about['内容'];
        view_plates()->addData($this->data);
        echo view_plates()->render("docs/onepage");
    }
}